const express = require("express");
const app = express();

app.use((req, res, next) => {
  console.log("服务器1被请求");
  next();
});

app.get("/students", (req, res) => {
  let studens = [
    { name: "张三", age: 10 },
    { name: "李四", age: 15 },
    { name: "王二麻", age: 20 },
  ];
  res.send(studens);
});

app.get("/", (req, res) => {
  res.send("Hello World!");
});

app.listen(5000, () => {
  console.log("服务器1启动成功");
});
